home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / qmac215.zip / CHANGE.QM < prev    next >
Text File  |  1990-06-27  |  2KB  |  46 lines

  1. *
  2. *  CHANGE:  AUTOEXEC SEARCH/REPLACE on several files.
  3. *
  4. *  This macro, when placed first in a QMac macro file, and executed using
  5. *  QEdit's /E command line option, will do a global search and replace on
  6. *  any number of files loaded from the command line.
  7. *
  8. *  To use:
  9. *           o   Make sure this macro is first in your macro file.
  10. *           o   Compile the macro file with QMAC:
  11. *
  12. *                       QMAC CHANGE.MAC CHANGE.QM B N
  13. *
  14. *           o   Run QEdit from the command line in this way:
  15. *
  16. *                       Q first.fil second.fil third.fil /Echange.mac
  17. *
  18. *               QEdit will stop, ask for the search & replace parameters,
  19. *               and then execute the change on all files you specified
  20. *               to load.
  21. *
  22. *               Of course you could specify wildcards such as *.* on the
  23. *               command line too, as long as you have the QCONFIG option
  24. *               "Load wildcarded filespecs from the command line?" set
  25. *               to YES in your copy of QEdit.
  26. *
  27. *               All files are saved to disk, and the editor exits
  28. *               at the end.
  29. *
  30. *  NOTE:  You need the following to use this macro:
  31. *
  32. *         QMac version 2.1 or higher
  33. *            and
  34. *         QEdit 2.1 *or* QEdit for OS/2 1.5 *or* QEdit TSR 1.1
  35. *
  36. @F1     MacroBegin
  37.         FindReplace Pause Return       * Ask for the find text
  38.         Pause Return                   * Ask for the replacement text
  39.         Pause EndLine "GN" Return      * Make sure No stop, and execute.
  40.         File                           * Save this file to disk & go to next
  41.     AGAIN:
  42.         RepeatFind File                * Repeat change & Save.  Keep going.
  43.         JTrue AGAIN                    * This jump is actually an "infinite
  44.                                        *   loop".  The fact that File will
  45.                                        *   terminate the editor breaks the loop
  46.